$boxshadow: 0 2px 8px #f0f1f2;
$transition: all 300ms cubic-bezier(0.23, 1, 0.32, 1);

.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}

.vue-flow-editor {
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  overflow: hidden;

  .vue-flow-editor-left {
    overflow: hidden;
    box-shadow: $boxshadow;
  }

  .vue-flow-editor-right {
    flex: 1;
    display: flex;
    flex-direction: column;

    overflow: hidden;
  }

  .vue-flow-editor-menu {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;

    .vue-flow-editor-menu-header {
      display: flex;
      align-items: center;
      justify-content: center;
      letter-spacing: 2px;
      color: black;
      box-shadow: $boxshadow;
      box-sizing: border-box;

      img {
        height: 100%;
      }
    }

    .vue-flow-editor-menu-list {
      flex: 1;
      overflow: hidden;
      background-color: #f9f9f9;
      user-select: none;

      .vue-flow-editor-menu-list-content {
        height: 100%;
        width: 100%;
        overflow-y: auto;
        overflow-x: hidden;
      }

      .vue-flow-edit-menu-group {
        .vue-flow-edit-menu-group-title {
          font-size: 14px;
          font-weight: 500;
          color: #777;
          background-color: white;
          padding: 0 16px;
          height: 40px;
          margin-top: 2px;
          display: flex;
          justify-content: space-between;
          align-items: center;
          cursor: pointer;
        }

        .vue-flow-edit-menu-group-content {
          box-sizing: border-box;
          padding: 6px;
        }

        &.vue-flow-edit-menu-group-expanded {
          .vue-flow-edit-menu-group-title {
            i {
              transform: rotate(180deg);
            }
          }
        }
      }

      .vue-flow-edit-menu {
        padding: 9px 16px;
        box-sizing: border-box;
        background-color: white;
        margin-bottom: 2px;
        cursor: move;
        font-size: 14px;
        color: #777;
        display: flex;
        justify-content: space-between;
        align-items: center;
        transition: all 300ms linear;

        &:hover {
          background-color: rgba(#1F74FF, 0.08);
          color: black;
        }

        &:active {
          background-color: rgba(#1F74FF, 0.08);
        }

        &:first-child {
          margin-top: 2px;
        }
      }
    }
  }

  .vue-flow-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 16px;
    box-shadow: $boxshadow;
    user-select: none;

    font-size: 14px;

    & > * {
      cursor: pointer;
      color: #777;
    }

    .vue-flow-editor-toolbar-item {
      width: 60px;
      height: 48px;
      outline: none;
      display: inline-flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;

      img {
        width: 16px;
        height: 16px;
        margin-bottom: 4px;
      }

      span {
        font-size: 12px;
        transform: scale(0.8);
      }

      &:hover {
        background-color: #f6f6f6;
        border-radius: 2px;
      }

      &.vue-flow-editor-toolbar-item-disabled {
        opacity: 0.5;
        background-color: transparent;
        cursor: not-allowed;
      }
    }

    .vue-flow-editor-toolbar-divider {
      height: 18px;
      border-left: solid 1px #ddd;
    }
  }

  .vue-flow-editor-canvas {
    flex: 1;
    overflow: hidden;
    user-select: none;

    .vue-flow-editor-canvas-target {
      position: relative;

      .g6-minimap {
        position: absolute;
        bottom: 0;
        right: 0;
        background-color: rgba(black, 0.1);
      }
    }
  }

  .vue-flow-editor-model {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    transition: $transition;
    transition-duration: 500ms;

    &:before {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      background-color: rgba(black, 0.1);
      content: '';
      transition: $transition;
      transition-duration: 500ms;
    }

    .vue-flow-editor-model-body {
      background-color: white;
      position: absolute;
      top: 0;
      bottom: 0;
      right: 0;
      display: flex;
      flex-direction: column;
      border-left: solid 1px #ddd;
      box-shadow: $boxshadow;
      transition: $transition;
      transition-duration: 500ms;

      .vue-flow-editor-model-head {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        padding: 0 16px;
        box-shadow: $boxshadow;

        & > i {
          cursor: pointer;
        }
      }

      .vue-flow-editor-model-content {
        flex: 1;
        overflow: auto;
      }

      .vue-flow-editor-model-foot {
        height: 50px;
        display: flex;
        justify-content: center;
        align-items: center;
        border-top: solid 1px #eee;
        box-shadow: $boxshadow;
      }
    }

    &.vue-flow-editor-transition-enter-active, &.vue-flow-editor-transition-leave-active {
      .vue-flow-editor-model-body {
        transform: translateX(0);
      }

      &:before {
        opacity: 1;
      }
    }

    &.vue-flow-editor-transition-enter, &.vue-flow-editor-transition-leave-to {
      .vue-flow-editor-model-body {
        transform: translateX(100%);
      }

      &:before {
        opacity: 0;
      }
    }
  }

  .vue-flow-editor-preview {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: $transition;
    transition-duration: 500ms;
    user-select: none;

    &:before {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      content: '';
      background-color: rgba(black, 0.1);
      transition: $transition;
      transition-duration: 500ms;
    }

    .vue-flow-editor-preview-body {
      width: 80%;
      height: 80%;
      background-color: white;
      border-radius: 12px;
      position: relative;
      z-index: 1;
      transition: $transition;
      transition-duration: 500ms;

      .vue-flow-editor-preview-close {
        position: absolute;
        top: -20px;
        right: -20px;
        font-size: 20px;
        background-color: white;
        height: 40px;
        width: 40px;
        border-radius: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: $boxshadow;
        border: 1px solid #eee;
        color: #999;
        cursor: pointer;
      }
    }

    &.vue-flow-editor-preview-transition-enter-active, &.vue-flow-editor-preview-transition-leave-active {
      .vue-flow-editor-preview-body {
        transform: translateX(0);
      }

      &:before {
        opacity: 1;
      }
    }

    &.vue-flow-editor-preview-transition-enter, &.vue-flow-editor-preview-transition-leave-to {
      .vue-flow-editor-preview-body {
        transform: translateY(-15%);
        opacity: 0;
      }

      &:before {
        opacity: 0;
      }
    }
  }
}